package com.ai.enviro.module.system.service;

import com.ai.enviro.exception.AssertUtils;
import com.ai.enviro.module.system.dao.dataobject.CameraDO;
import com.ai.enviro.module.system.dao.mysql.CameraDao;
import com.gc.easy.flv.service.IOpenFLVService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class RtspDataService implements IOpenFLVService {

    @Autowired
    private CameraDao cameraDao;
    @Override
    public String getUrl(Integer channel) {
        if(channel == null){
            channel =1;
        }
        CameraDO camera = cameraDao.getById(channel);
        AssertUtils.notNull(camera,"摄像头未配置");
        AssertUtils.notBlank(camera.getUrl(),"摄像头推流地址未配置");
        return camera.getUrl();
    }
}